package com.woniu.liuzhougov.relatedinformation.service.impl;

import com.woniu.liuzhougov.relatedinformation.dao.ContactInformationMapper;
import com.woniu.liuzhougov.relatedinformation.pojo.ContactInformation;
import com.woniu.liuzhougov.relatedinformation.service.RelatedInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Description: desc
 * @author: Chris
 * @createDate: 2019/4/24 0024
 * @version: 1.0
 */
@Service("contactInformationService")
public class ContactInformationServiceImpl implements RelatedInformationService<ContactInformation> {

    @Autowired
    private ContactInformationMapper contactInformationMapper;

    @Override
    public List<ContactInformation> selectList() {
        return contactInformationMapper.selectList();
    }

    @Override
    public List<ContactInformation> selectByName(String name) {
        return contactInformationMapper.selectByName(name);
    }

    @Override
    @Transactional
    public int deleteById(Integer id) {
        return contactInformationMapper.deleteByPrimaryKey(id);
    }

    @Override
    public ContactInformation selectById(Integer id) {
        return contactInformationMapper.selectByPrimaryKey(id);
    }

    @Override
    @Transactional
    public int insert(ContactInformation contactInformation) {
        return contactInformationMapper.insert(contactInformation);
    }

    @Override
    @Transactional
    public int update(ContactInformation contactInformation) {
        return contactInformationMapper.updateByPrimaryKey(contactInformation);
    }
}
